<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
<meta name="decorator" content="moduleList" />
<script type="text/javascript" src="${staticPath}/js/brand.js"></script>
<script type="text/javascript">
$(function() {
	$("#toSap").removeAttr("disabled");
});
</script>
</head>
<body>
<form:form name="listForm" action="" modelAttribute="supplier" method="post" class="form-inline" role="form">
		<ol class="breadcrumb map_1">
			<li><a href="${contextPath}/index">首页</a></li>
			<li><a href="${contextPath}/biz/brand/supplier/userinfo?navId=${navId}">供应商品牌</a></li>
			<li class="active">供应商列表</li>
		</ol>
	    <input type="hidden" name="deleteIds" >
	    <input type="hidden" name="sendIds" >
    	<div class="o-l-search-builder f_1">
    	<div id="statement-search-builder" class="collapse" style="height:auto;">
    		<div class="f_2">
	                 <div class="form-group col-sm-6">
	                      <label for="inputEmail3" class="col-sm-3 control-label f_4">供应商类型：</label>
	                      <div class="col-sm-9 f_6">
	                        <ossp:select dictType="supplierType" defaultSelected="${ supplier.supplierType}" name="supplierType" id="supplierType" class_="f_5"></ossp:select>
	                      </div>
	                  </div>
	                  <div class="form-group col-sm-6">
	                      <label for="inputEmail3" class="col-sm-3 control-label f_7">供应商编号：</label>
	                      <div class="col-sm-9 f_6">
	                         <form:input id="supplierNo" path="supplierNo"class="f_5" placeholder="供应商编号"/>
	                      </div>
	                  </div>
	             </div>
	         	<div class="f_2">
	                 <div class="form-group col-sm-6">
						<label for="quality" class="col-sm-3 control-label f_4">供应商状态:</label>
						<div class="col-sm-9 f_6">
							<ossp:select dictType="SUPPLIER_STATUTS" defaultSelected="${supplier.supplierStatus}" name="supplierStatus" id="supplierStatus" class_="f_5"></ossp:select>
						</div>
					</div>
	                  <div class="form-group col-sm-6">
	                      <label for="inputEmail3" class="col-sm-3 control-label f_7">组织机构代码：</label>
	                      <div class="col-sm-9 f_6">
	                         <form:input id="organizationCode" path="organizationCode" placeholder="请输入组织机构代码" 
								htmlEscape="false" rows="4" class="f_5" />
	                      </div>
	                  </div>
	             </div>
	         </div>
	         <div class="f_8">
	              <div class="f_2">
	                  <div class="col-sm-8 f_6">
	                        <form:input id="cname" path="cname"class="f_5" placeholder="供应商名称"/>
	                  </div>
	                  <button type="submit" class="btn btn-warning btn_1">查&nbsp;询</button>
	             </div>
	         </div>
	         <div class="o-l-chevron-down"><a href="#" class="btn btn-default" data-toggle="collapse" data-target="#statement-search-builder" id="chevronDownBtn" role="button"><span id="glyphiconspan" class="glyphicon glyphicon-chevron-up"></span></a>
	         </div>
	     </div>
    	<div class="o-l-search-builder f_1">
    	<shiro:hasPermission name="com.maoye.ossp.biz.brand.supplier.Supplier:delete">
              <button type="button" class="btn btn-danger btn_5 btn_right" onclick="Oosp_DelAll('${contextPath}/biz/brand/supplier/deleteAll?navId=${navId }','table1')">删&nbsp;除</button>
              </shiro:hasPermission>
              <shiro:hasPermission name="com.maoye.ossp.biz.brand.brandsap:suppliersap">
              <button type="button" id="toSap" class="btn btn-info btn_5 btn_right" onclick="send_IDs('${contextPath}/biz/brand/supplier/sapAll?navId=${navId }','table1')">发送SAP</button>
              </shiro:hasPermission>
              <shiro:hasPermission name="com.maoye.ossp.biz.brand.supplier.Supplier:add">
              <button type="button" class="btn btn-info btn_5 btn_right" onclick="window.open('${contextPath}/biz/brand/supplier/add?navId=${navId }','_self')">新&nbsp;建</button>
              </shiro:hasPermission>
        </div>   
	<tags:message content="${message}" />
	<div class="o-l-search-builder f_9">
		<table class="table table-striped table-hover o-l-table table-bordered" id="table1">
			<thead class="t_1">
			<tr>
				<th style="width: 1px"><input type="checkbox" data-ckb="all"></th>
				<th>编号</th>
				<th>供应商名称</th>
				<th>类别</th>
				<th>登录账号</th>
				<th>状态</th>
			</tr>
		</thead>
		<tbody>
			<c:choose>
				<c:when test="${page.list == null}">
					<tr>
						<td>${supplier.supplierNo}</td>
					</tr>
				</c:when>
				<c:otherwise>
					<c:forEach items="${page.list}" var="supplier">
							<tr
								data-herf="${contextPath}/biz/brand/supplier/${supplier.id}/view?navId=${navId }"
								data-target="_self">
								<td class="o-l-tab-ckb"><input type="checkbox"
									data-ckb-id="${supplier.id}"></td>
								<td>${supplier.supplierNo}</td>
								<td>${supplier.cname}</td>
								<td><ossp:value dictType="supplierType" key="${supplier.supplierType}"/></td>
								<td>${supplier.username == null ? "未开通" : supplier.username }</td>
								<td><ossp:value dictType="SUPPLIER_STATUTS" key="${supplier.supplierStatus}"/></td>
								<%--  <td><ossp:value dictType="SEND_SAP_FLAG" key="${supplier.isActive}"/></td>--%>
							</tr>
					</c:forEach>
					
				</c:otherwise>
			</c:choose>
		</tbody>
	</table>
	</div>
	<pager:pager pageSize="${page.pageSize}" pageNo="${page.pageNo}" url="" total="${page.total}"/>
	<script type="text/javascript" src="${staticPath}/js/list.js"></script>
</form:form>
</body>
</html>